package cn.tips.dmp.system.assist.message.repository;

import cn.tips.dmp.supports.jpa.BaseJpaDslRepository;
import cn.tips.dmp.system.assist.message.po.SystemMessageReceiverPo;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

public interface SystemMessageReceiverRepository extends BaseJpaDslRepository<SystemMessageReceiverPo, Long> {

    @Transactional(rollbackFor = Exception.class)
    @Modifying(clearAutomatically = true)
    @Query(value = "update SystemMessageReceiverPo a set a.messageReadState=1 where a.id=:id")
    void updateMessageReadStateById(@Param("id") Long id);
}
